﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class YCStatusBill : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["userName"] == null || Session["roleID"] == null)
        {
            Response.Redirect("Login.aspx");
            Response.End();
        }
        if (!Page.IsPostBack)
        {
            lblBackUrl.Text = Request.UrlReferrer.ToString();
            BindToRpYCChekBill();
        }

    }
    protected void BindToRpYCChekBill()
    {
        string YCId = Request.QueryString["ycid"].ToString();        
        string currentYear = YCId.Substring(2, 4);
        string tabName = "YCSTEPS" + currentYear;
        DBOperation DBO = new DBOperation();
        string sqlstring = "select * from " + tabName + " where YCID='" + YCId + "' order by SEQ ASC,AUTOID ASC";
        DataSet ds = DBO.GetDataSet(sqlstring, "TEMP");
        rpYCCheckBill.DataSource = ds.Tables["TEMP"].DefaultView;
        rpYCCheckBill.DataBind();
        lblYCId.Text = YCId;
 
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        string refURL = "MessageInfo.aspx";

        refURL = lblBackUrl.Text;
        if (refURL == "" || refURL == null || refURL == "MenuDir.aspx")
        {
            refURL = "MessageInfo.aspx";
        }
        Response.Redirect(refURL);
    }
}
